package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.TeacherInfoDao;
import com.internship.model.TeacherInfo;
import com.internship.page.Page;

@Service
public class TeacherInfoService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private TeacherInfoDao teacherInfoDao;

	public TeacherInfo geTeacherInfoByZGH(String ZGH) {
		return teacherInfoDao.geTeacherInfoByZGH(ZGH);
	}
	public Page<TeacherInfo> getTeacherInfoList(String BM,String XM,int pageNumber) {
		Page<TeacherInfo> page = new Page<TeacherInfo>(pageNumber, PAGE_SIZE);
		List<TeacherInfo> list = teacherInfoDao.getTeacherInfoList(BM, XM, page);
		page.setResultList(list);
		return page;
	}
	public List<TeacherInfo> getTeacherInfoList() {
		List<TeacherInfo> list = teacherInfoDao.getTeacherInfoList();
		return list;
	}
	public int addTeacherInfo(TeacherInfo teacherInfo) {
		return teacherInfoDao.addTeacherInfo(teacherInfo);
	}
	public int updateAdmin(TeacherInfo teacherInfo) {
		return teacherInfoDao.updateTeacherInfo(teacherInfo);
	}
	public int updatePhone(TeacherInfo teacherInfo) {
		return teacherInfoDao.updatePhone(teacherInfo);
	}
	public int delTeacherInfo(String ZGH) {
		return teacherInfoDao.delTeacherInfo(ZGH);
	}
	public int delAll(String[] ids) {
		return teacherInfoDao.delAll(ids);
	}
	public List<TeacherInfo> getDistributionTeacherInfoList(String BM) {
		List<TeacherInfo> list = teacherInfoDao.getDistributionTeacherInfoList(BM);
		return list;
	}

}
